import com.demo.controller.StudentController;
import com.demo2.controller.SayHiCt;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
//        //获取Spring对象(Spring上下文)
//        ApplicationContext context =
//                new ClassPathXmlApplicationContext("spring-config.xml");
//
//        StudentController sc = context.getBean("studentController", StudentController.class);
//        sc.sayHi();

        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");
//        SayHiCt sayHiCt = context.getBean("sayHiCt", SayHiCt.class);
//        sayHiCt.sayHi();
//        context.getBean("sayHi");
//        String str = (String) context.getBean("HiChina");
//        System.out.println(str);
//        SayHiCt sayHiCt = context.getBean("sayHiCt", SayHiCt.class);
        String str = (String) context.getBean("stu1");
        System.out.println(str);
    }
}
